<?php
    $form = $this->form;
    $form->prepare();
    $form->setAttribute('action', $this->url('admin/user/login' , array('action' => 'login')));
    $form->setAttribute('method', 'post');
    $form->setAttribute('class' , 'form');
?>

<div id="signin-page">
    <div class="page-form">
        <?php if(count($flashMessages)) {
            foreach ($flashMessages as $msg) { ?>
                <div class="alert alert-block alert-success">
                    <a class="close" data-dismiss="alert" href="#">×</a>
                    <p><?php echo $this->translate($msg) ?></p>
                </div>
            <?php }
        } ?>
        <?php echo $this->form()->openTag($form); ?>
        <div class="form-group <?php echo ($this->formElementErrors($form->get('identity'))) ? 'has-error' : ''; ?>">
            <div class="header-content"><h1>Log In</h1></div>
            <div class="body-content">
                <div class="form-group">
                    <div class="col-md-12">
                        <?php echo $this->formInput($form->get('identity')) ?>
                    </div>
                    <div class="col-md-12">
                        <div class="help-block">
                            <?php echo $this->formElementErrors($form->get('identity')); ?>
                        </div>
                    </div>
                </div>

                <div class="form-group <?php echo ($this->formElementErrors($form->get('credential'))) ? 'has-error' : ''; ?>">
                    <div class="col-md-12">
                        <?php echo $this->formInput($form->get('credential')) ?>
                    </div>
                    <div class="col-md-12">
                        <div class="help-block">
                            <?php echo $this->formElementErrors($form->get('credential')); ?>
                        </div>
                    </div>
                </div>
                <div class="form-group pull-left">

                </div>
                <div class="form-group pull-right">
                    <?php echo $this->formButton($form->get('submit')) ?>
                </div>
                <div class="clearfix"></div>
                <?php if ($this->redirect): ?>
                    <input type="hidden" name="redirect" value="<?php echo $this->escapeHtml($this->redirect) ?>" />
                <?php endif ?>

            </div>
        </div>
        <?php echo $this->form()->closeTag(); ?>
    </div>
</div>